package com.tc.controller;


import com.alibaba.nacos.api.config.annotation.NacosValue;
import com.tc.domain.dataobject.UserDO;
import com.tc.common.response.Response;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class TestController {

    @NacosValue(value = "${rate-limit.api.limit}", autoRefreshed = true)
    private Integer limit;
    @GetMapping("/test")
    public String test(){
        return "当前限流阈值：" + limit;
    }


    @PostMapping("/test2")
    public Response<UserDO> test2(@RequestBody UserDO user){
        return Response.success(user);
    }
}
